package zxr.demo;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import zxr.learn.User;
import zxr.learn.Userxml;

public class testaop {
    @Test
//    基于注解的aop实现(aopbean.xml)
    public  void testaoppro(){
        ApplicationContext context = new ClassPathXmlApplicationContext("aopbean.xml");
        User user = context.getBean("user", User.class);
        user.add();
    }

    @Test
//    基于xml配置文件的aop实现(aopbean1.xml)
    public  void testaopxmlpro(){
        ApplicationContext context = new ClassPathXmlApplicationContext("aopbean1.xml");
        Userxml userxml = context.getBean("userxml", Userxml.class);
        userxml.add();
    }
}
